package com.xhs.main.controller.yfb;

import com.xhs.main.entity.result.LayuiResponseResult;
import com.xhs.main.entity.yfb.YfbTest;
import com.xhs.main.service.yfb.YfbTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @create 2020-10-22 21:35
 */
@RestController
public class TestController {
    @Autowired
    YfbTestService yfbTestService;

    @RequestMapping("/yfb/addTest")
    public LayuiResponseResult addTest(YfbTest yfbTest) {
        String format = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
        yfbTest.setYfbTestCreatetime(format);
        yfbTestService.createTest(yfbTest);
        return new LayuiResponseResult(0, "", 1, "");
    }
}
